
#include "flag_checker.h"
//#include "generic_table.cpp"

#include "main_container.h"
#include "errors_warnings.h"
extern MainContainer * CompilerData;


FlagChecker::FlagChecker()
{
	FileNameTable = new GenericTable<string>;
}


FlagChecker::~FlagChecker()
{
	if(FileNameTable != NULL)
	{
		delete FileNameTable;
		FileNameTable = NULL;
	}
}

void FlagChecker::ProcessArguments(int argc, char ** argv)
{
#ifdef TRACE
	CompilerData->LogTrace->ReportEntry("ProcessArgumets");
#endif

	for(int i = 1; i < argc; i++)
	{

#ifdef TRACE
		CompilerData->LogTrace->ReportLine("File name detected...");
		CompilerData->LogTrace->ReportValue("i", i);
		CompilerData->LogTrace->ReportValue("argv[i]", argv[i]);
#endif

		string * s = new string();
		s->assign(argv[i]);
		FileNameTable->Add(s);
	}

#ifdef TRACE
	CompilerData->LogTrace->ReportExit("ProcessArguments");
#endif
}
